home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
crpplay.dir
/
00072_Script_MOVIE handlers
< prev
next >
Wrap
Text File
|
1996-05-27
|
6KB
|
213 lines
-- ----------------------------------------------------------------
-- Handler initializePictureGame does whatever is necessary to
-- make the game work.
on initializePictureGame
setPictureGameSprites
setPictureGamePuppets(TRUE)
setPictureGameCastLists
setColorStatus
global numColors
set numColors = 5
end
-- ----------------------------------------------------------------
-- Handler setPictureGameSprites sets the sprites for each clickable
-- item in the picture
on setPictureGameSprites
global ceiling, floor, people, table, walls
set ceiling = 2
set floor = 3
set people = 4
set table = 15
set walls = 6
end
-- ----------------------------------------------------------------
-- Handler setPictureGamePuppets sets the puppets of each the sprites for the
-- clickable items in the picture to the given value.
on setPictureGamePuppets val
global ceiling, floor, people, table, walls
puppetSprite ceiling, val
puppetSprite floor, val
puppetSprite people, val
puppetSprite table, val
puppetSprite floor, val
puppetSprite walls, val
end
-- ----------------------------------------------------------------
-- Handler setPictureGameCastLists sets the list of casts for each object
-- whose color is changeable.
on setPictureGameCastLists
global ceilingCasts, floorCasts, peopleCasts, tableCasts
global wallsCasts
set ceilingCasts = ["ceiling ORIGINAL", "ceiling DARK", "ceiling GAY", "ceiling HAPPIER", "ceiling LIGHT"]
set floorCasts = ["floor ORIGINAL", "floor DARK", "floor GAY", "floor HAPPIER", "floor LIGHT"]
set peopleCasts = ["people ORIGINAL", "people DARK", "people GAY", "people HAPPIER", "people LIGHT"]
set tableCasts = ["table ORIGINAL", "table DARK", "table GAY", "table HAPPIER", "table LIGHT"]
set wallsCasts = ["walls ORIGINAL", "walls DARK", "walls GAY", "walls HAPPIER", "walls LIGHT"]
end
-- Handler setColorStatus sets the color mixture
on setColorStatus
global colorStatusList
set colorStatusList = ["ORIGINAL","ORIGINAL","ORIGINAL","ORIGINAL","ORIGINAL"]
end
-- ----------------------------------------------------------------
-- Handler changeColor changes the color of the given object when
-- it is clicked on
on changeColor object
global ceilingCasts, floorCasts, peopleCasts, tableCasts
global wallsCasts, numColors
global ceiling, floor, people, table, walls
if object = "ceiling" then
set castList = ceilingCasts
set changeSprite = ceiling
set colorPosition = 1
else if object = "floor" then
set castList = floorCasts
set changeSprite = floor
set colorPosition = 2
else if object = "people" then
set castList = peopleCasts
set changeSprite = people
set colorPosition = 3
else if object = "table" then
set castList = tableCasts
set changeSprite = table
set colorPosition = 4
else if object = "walls" then
set castList = wallsCasts
set changeSprite = walls
set colorPosition = 5
end if
set newCast = getAt(castList,random(numColors))
set newColor = word 2 of newCast
set the castNum of sprite changeSprite = the number of cast newCast
-- set colorOffset = getColorOffset(newColor)
-- changeGroupColors(object, colorOffset, newColor)
updateStage
upDateColorMixture(colorPosition,newColor)
checkColorMixture
end
-- ----------------------------------------------------------------
-- Handler getColorOffset returns the position in the cast lists
-- that the color is found in.
on getColorOffset color
if color = "DARK" then
return 2
else if color = "GAY" then
return 3
else if color = "HAPPIER" then
return 4
else if color = "LIGHT" then
return 5
else if color = "ORIGINAL" then
return 1
end if
end
-- ----------------------------------------------------------------
-- Handler changeGroupColors receives and object and the castOffset
-- and changes the casts of all objects in the object's group to
-- the same color.
--
-- NOT USED IN THIS VERIOSN - NO GROUPS
--
-- on changeGroupColors object, colorOffset, newColor
-- global chairGroup, wallsGroup, yellowGroup
--
-- if listMember(object, chairGroup) then
-- set group = chairGroup
-- else if listMember(object, wallsGroup) then
-- set group = wallsGroup
-- else if listMember(object, yellowGroup) then
-- set group = yellowGroup
-- else -- not in a group
-- set group = []
-- end if
--
-- repeat with i = 1 to count(group)
-- -- the groups members are strings which correspond to the
-- -- global variables for sprites. so, use the value of the
-- -- string to get the sprite whose cast needs to be changed.
-- set member = getAt(group,i)
-- set whichSprite = value(member)
-- set newCast = member && newColor
-- set the castNum of sprite whichSprite = the number of cast newCast
-- end repeat
--end
--
-- ----------------------------------------------------------------
-- Handler listMember returns TRUE if the given object is a member
-- of the given list and FALSE otherwise.
on listMember object, aList
set memberP = FALSE
repeat with i = 1 to count(aList)
if object = getAt(aList, i) then
set memberP = TRUE
exit Repeat
end if
end repeat
return memberP
end
on upDateColorMixture colorPosition,newColor
global colorStatusList
setAt colorStatusList,colorPosition,newColor
put colorStatusList
end
on checkColorMixture
global colorStatusList
if colorStatusList = ["ORIGINAL","ORIGINAL","ORIGINAL","ORIGINAL","ORIGINAL"] then
puppetSound "original"
else if colorStatusList = ["DARK","DARK","DARK","DARK","DARK"] then
puppetSound "dark"
else if colorStatusList = ["GAY","GAY","GAY","GAY","GAY"] then
puppetSound "gay"
else if colorStatusList = ["HAPPIER","HAPPIER","HAPPIER","HAPPIER","HAPPIER"] then
puppetSound "happier"
else if colorStatusList = ["LIGHT","LIGHT","LIGHT","LIGHT","LIGHT"] then
puppetSound "light"
end if
end